package com.qw.badge.sample

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent


/**
 * Created by qinwei on 2021/6/20 5:13 下午
 * email: qinwei_it@163.com
 */
class VIVOBadge : IBadge {
    @SuppressLint("WrongConstant")
    override fun setBadgeNum(context: Context, num: Int) {
        val intent = Intent()
        intent.action = "launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM"
        intent.putExtra("packageName", context.packageName)
        intent.putExtra("className", MainActivity::class.java.canonicalName)
        intent.putExtra("notificationNum", num)
        intent.addFlags(0x01000000)
        context.sendBroadcast(intent)
    }
}